﻿<%@ Page EnableViewState="false" Language="C#" CodeBehind="Default.aspx.cs" 
Inherits="UserStuff.WebForm"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title></title>
    <style type="text/css">
        p{text-align: left; text-indent: 3em;}
    </style>
</head>
<body>

    <h3>Musician User Input Test Page</h3>

    <form id="Form1" runat="server">
    
    <%-- Textboxes ------------------ --%>
        <%-- User Name --%>
        <p>Name: 
           <asp:TextBox id="textBox1" runat="server" />
           <asp:RequiredFieldValidator ID="RequiredFieldValidator1" Runat="Server"
            ControlToValidate="textBox1"
            Display="Dynamic"
            ErrorMessage="Please enter some data!"/>
        </p>

        <%-- User Location --%>
        <p>Location: 
           <asp:TextBox id="textBox2" runat="server" />
           <asp:RequiredFieldValidator ID="RequiredFieldValidator2" Runat="Server"
            ControlToValidate="textBox2"
            Display="Dynamic"
            ErrorMessage="Please enter some data!"/>
        </p>

        <%-- User Instrument --%>
        <p>Instrument: 
           <asp:TextBox id="textBox3" runat="server" />
           <asp:RequiredFieldValidator ID="RequiredFieldValidator3" Runat="Server"
            ControlToValidate="textBox3"
            Display="Dynamic"
            ErrorMessage="Please enter some data!"/>
        </p>
     
    <%-- Buttons ---------------------------- --%>
            
        <%-- Submission Button --%>
        <p><asp:Button id="button1" runat="server" text="Add" OnClick="button1Click" /></p>
    
        <%-- Display Database. CausesValidation must be false--%>
        <p><asp:Button id="button2" runat="server" Text="View" OnClick="button2Click" CausesValidation="false" /></p>
    
    <%-- Searches ------------------- --%>

        <p><asp:TextBox id="textBox4" runat="server" />
           <asp:Button id="searchButton" runat="server" Text="Search" OnClick="searchClick" />
        </p>

        <p><asp:Label ID="label1" runat="server" /></p>
    
    <%-- Display the database ------------- --%>
        
        <asp:Repeater id="MusicianRepeater" Runat="Server">
            
            <HeaderTemplate>
            <table border="1" width="100%">
                <tr>
                <th>Name</th>
                <th>Location</th>
                <th>Instrument</th>
                </tr>
            </HeaderTemplate>
            
            <ItemTemplate>
            <tr>
                <td><%#Eval("name")%></td> 
                <td><%#Eval("location")%></td>
                <td><%#Eval("instrument")%></td>        
            </tr>
            </ItemTemplate>

            <FooterTemplate>
                <tr>
                <td colspan="5" style="font-size:10pt; font-style:italic">
                    Current Users
                </td>
                </tr>
            </FooterTemplate>

        </asp:Repeater> 
    
    </form>

</body>
</html>